import request from "@/utils/request";

/**
 * 创建老人入住申请
 * @param {Object} data 表单数据
 * @returns Promise
 */
export function createElder(data) {
  return request({
    url: '/check/checkin/create',  // 后端接口地址
    method: 'post',
    data
  });
}
export function review(data){
  return request({
    url: '/check/checkin/review',
    method: 'post',
    data
  });
}
export function submitApproval(param) {
  return request({
    url: '/check/checkin/submit', // 后端接口地址
    method: 'put',
    params: param // 这里用 params 代替 data，发送为 URL 查询参数
  });
}
export function checkInConfig(data){
  return request({
    url: '/check/checkin/checkInConfig',
    method: 'post',
    data
  });
}
export function sign(data){
  return request({
    url: '/check/checkin/sign',
    method: 'post',
    data
  });
}
export function getElderInfo(params) {
  return request({
    url: '/check/checkin/getElderInfo',
    method: 'get',
    params  // 直接传对象，例如 { businessId: 'xxx' }
  })
}
export function getApprovalRecord(params) {
  return request({
    url: '/check/checkin/getApprovalRecord',
    method: 'get',
    params  // 直接传对象，例如 { businessId: 'xxx' }
  })
}
export function getCareLevelAndBedList(){
  return request({
    url: '/check/checkin/getCareLevelAndBedList',
    method: 'get'
  })
}